<%@ page import="br.com.rosena.model.bean.persistente.Persistente" %>
<%@ page import="java.util.List" %>
<%@ page import="br.com.rosena.model.bean.persistente.Objeto" %>
<%@ page import="br.com.rosena.view.gui.actions.ACFRMLoginPrincipal" %>
<%
    long idUsuario = ((Long) request.getSession().getAttribute("ID_Usuario")).longValue();
    String webSite = (String)request.getSession().getAttribute("WEBSITE");

    Persistente objUsuario = new Persistente("Usuario",idUsuario);
    List lstObjetosSuperiores = (List) objUsuario.invocarMetodo("selecionarObjetoSuperior");
    ACFRMLoginPrincipal.objUsuarioLogado = objUsuario;
%>
<html>
<head><title>::Cvonic::</title>
 <link REL="SHORTCUT ICON" href="imagens/Rosena.jpg">
<script type="text/javascript">
    //AJAX
    function abrirMenu(nomeClasse,event) {
        var pagina = window.location+"<%=webSite%>/paginas.jsp?nomeClasse="+nomeClasse;
        pagina = pagina.replace("principal.jsp#","");
        pagina = pagina.replace("principal.jsp","");
        document.getElementById("iframe02").src = pagina;
        document.getElementById('iframe02').location.reload(true);
    }
    function abrirMenudbl(nomeClasse){
        var pagina = window.location+"<%=webSite%>/paginas.jsp?nomeClasse="+nomeClasse;
        var width = 150;
        var height = 250;
        var left = 99;
        var top = 99;
        window.open(pagina,'_'+nomeClasse);
    }
    function abrirMenuJSP(nomeClasse,event) {
        var pagina = window.location+"<%=webSite%>/"+nomeClasse;
        pagina = pagina.replace("principal.jsp#","");
        pagina = pagina.replace("principal.jsp","");
        document.getElementById("iframe02").src = pagina;
        document.getElementById('iframe02').location.reload(true);
    }
    function abrirMenudblJSP(nomeClasse){
        var pagina = window.location+"<%=webSite%>/"+nomeClasse;
        var width = 150;
        var height = 250;
        var left = 99;
        var top = 99;
        window.open(pagina,'_'+nomeClasse);
    }
    function atualizarPagina(str) {
        document.getElementById("telas").innerHTML = str;
    }

    function horizontal(quant) {
        for(var j=0;j<quant;j++){
            var navItems = document.getElementById('menu_dropdown'+j).getElementsByTagName('li');
            for (var i=0; i< navItems.length; i++) {
                if(navItems[i].className == 'submenu'){
                    if(navItems[i].getElementsByTagName('ul')[0] != null){
                        navItems[i].onmouseover=function() {
                            this.getElementsByTagName('ul')[0].style.display='block';
                            //this.style.backgroundColor = '#f9f9f9';
                        }
                        navItems[i].onmouseout=function() {
                            this.getElementsByTagName('ul')[0].style.display='none';
                            //this.style.backgroundColor = '#FFFFF';
                        }
                    }
                }
            }
        }
    }
</script>
<style type="text/css">

    .table01{
        font: normal 60.5% verdana;
    }

    ul.menubar{
        margin: 0px;
        padding: 0px;
        background-color: #FFFFFF; /* IE6 Bug */
        font-size: 100%;
    }

    ul.menubar .submenu{
        margin: 0px;
        padding: 0px;
        list-style: none;
        background-color: #FFFFFF;
        border: 1px solid #ccc;
        float:left;
    }

    ul.menubar ul.menu{
        display: none;
        position: absolute;
        margin: 0px;
    }

    ul.menubar a{
        padding: 5px;
        display:block;
        text-decoration: none;
        color: #777;
        padding: 5px;
    }

    ul.menu, ul.menu ul{
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #ccc;
        width: 150px; /* Width of Menu Items */
        background-color: #FFFFFF; /* IE6 Bug */
    }

    ul.menu li{
        position: relative;
        list-style: none;
        border: 0px;
    }

    ul.menu li a{
        display: block;
        text-decoration: none;
        border: 1px solid #ccc;
        border-bottom: 0px;
        color: #777;
        padding: 5px 10px 5px 5px;
    }

    ul.menu li sup{
        font-weight:bold;
        font-size:7px;
        color: red;
    }

    /* Fix IE. Hide from IE Mac \*/
    * html ul.menu li { float: left; height: 1%; }
    * html ul.menu li a { height: 1%; }
    /* End */

    ul.menu ul{
        position: absolute;
        display: none;
        left: 149px; /* Set 1px less than menu width */
        top: 0px;
    }

    ul.menu li.submenu ul { display: none; } /* Hide sub-menus initially */

    ul.menu li.submenu { background: transparent url(arrow.gif) right center no-repeat; }

    ul.menu li a:hover { color: #E2144A; }
</style>
</head>
<body width="100%" onload="horizontal(<%=lstObjetosSuperiores.size()%>);">
<table  class="table01" width="100%" height="100%">
    <tr width="100%" height="5%">
        <td colspan="2">
            <%@ include file="menu.jsp" %>
        </td>
    </tr>
    <tr width="100%" height="100%">                                     
        <td valign="top" colspan="2">
            <iframe id="iframe02" src="defalt.jsp"  frameborder="1" width="100%" scrolling="auto" height="100%"> </iframe>
        </td>
    </tr>
     <tr width="100%" height="5%">
        <td align="left">
            Usuario logado :: <%=ACFRMLoginPrincipal.objUsuarioLogado.getString("descricao")%>   
         </td>
         <td align="left">
            Empresa :: <%=( (Persistente) request.getSession().getAttribute("FILIAL") ).getString("descricao")%>
         </td>
    </tr>
</table>
</body>
</html>